﻿@*
The model type for this template is Enum, which allows us to work with any enumeration. 
We can then apply the UIHint attribute.
*@

@model Enum
@Html.DropDownListFor(m => m, Enum.GetValues(Model.GetType()).Cast<Enum>().Select(m =>
{
    string enumVal = Enum.GetName(Model.GetType(), m);
    return new SelectListItem()
    {
        Selected = (Model.ToString() == enumVal),
        Text = enumVal,
        Value = enumVal
    };
}))